package com.codemobiles.droidslator.util;

import android.content.Context;
import android.graphics.Typeface;
import android.widget.EditText;
import android.widget.TextView;

public class FontsManager {

  // set bulit-in font (thai by droidsans.com)
  private static Typeface fontFace_reg;
  //private static Typeface fontFace_bold;
  //private static Typeface fontFace_italic;

  public static void init(Context ctx) {
    fontFace_reg = Typeface.createFromAsset(ctx.getAssets(), "fonts/DroidSerif-Regular.ttf");
    //fontFace_bold = Typeface.createFromAsset(ctx.getAssets(), "fonts/DroidSerif-Bold.ttf");
    //fontFace_italic = Typeface.createFromAsset(ctx.getAssets(), "fonts/DroidSerif-Italic.ttf");
  }

  public static EditText getSupportedFontEditText(EditText _editText) {
    _editText.setTypeface(fontFace_reg, 0); // regular
    //_editText.setTypeface(fontFace_bold, 1); // bold
    //_editText.setTypeface(fontFace_italic, 2); // itatic
    return _editText;
  }
  
  public static TextView getSupportedFontTextView(TextView _textView) {
    _textView.setTypeface(fontFace_reg, 0); // regular
    //_textView.setTypeface(fontFace_bold, 1); // bold
    //_textView.setTypeface(fontFace_italic, 2); // itatic
    return _textView;
  }
}
